
<h1>Edit Event</h1>
<?php
echo $this->Form->create('Event', array('action' => 'edit'));
echo $this->Form->input('name');
echo $this->Form->input('description', array('rows' => '3'));
echo $this->Form->input('id', array('type' => 'hidden'));
echo $this->Form->end('Save informtation');

?>
          <table >
	<tr style="background-color:#FFFFFF">
		<th> Text </th>
		<th> time </th>
		<th> created by </th>
		<th> Repetitions </th>
		<th> Status </th>
		<th> actions </th>
		
	</tr>
	<?php for($i = 0; $i < sizeof($eventtweets) ; $i++) 
		{ ?>
		
	<tr style="background-color:#FFFFFF">
			
		<td> <?php echo $eventtweets[$i]['FutureTweet']['tweetText'] ?></td>
		<td> <?php echo $eventtweets[$i]['FutureTweet']['release_date'] ?></td> 
		<td> <?php echo $names1[$i]['User']['fullname'] ?></td>
	    <td> <?php echo $repetitions[$i] ?></td>
		
		<td>
	
            <?php if($eventtweets[$i]['FutureTweet']['approved'] == 1) {
            	echo "Approved";
                }
            else{
            	echo "Not Approved";
            }
		?>
        </td>	
				
		 <td>
	
            <?php if($repetitions[$i] == 1)
               { 
            	echo $this->Form->postLink(
                'Delete',
                array('action' => 'deleteeventtweet', $eventtweets[$i]['FutureTweet']['id'] , 
                	$eventtweets[$i]['FutureTweet']['eventID'] , null));
            }
            else
            {
            	echo $this->Form->postLink(
                'Delete',
                array('action' => 'deleteallrepeated', $eventtweets[$i]['FutureTweet']['tweetText'] , 
                	$eventtweets[$i]['FutureTweet']['eventID'] , $eventtweets[$i]['FutureTweet']['sub_time']));
            }
            ?>
            &nbsp;|&nbsp;
            <?php
		 if($repetitions[$i] > 1)
           {
           	echo $this->Html->link('Edit', array('action' => 'editTweetrepeated', $eventtweets[$i]['FutureTweet']['tweetText'] , $eventtweets[$i]['FutureTweet']['eventID']));
 		   }    
 		   else 
 		   {
 		   	echo $this->Html->link('Edit', array('action' => 'editTweet', $eventtweets[$i]['FutureTweet']['id'] ,
 		   		$eventtweets[$i]['FutureTweet']['eventID'] , null));
 		}   
 		?>
        </td>
	</tr>

	<?php }; ?>
	
	<tr style="background-color:#FFFFFF">
	<?php echo $this->Html->link('Add Tweet', array('action' => 'AddTweet', $id)); ?>
	&nbsp;|&nbsp;
	<?php echo $this->Html->link('Save and Exit', array('action' => 'save', $id)); ?>
	&nbsp;|&nbsp;
	<?php echo $this->Html->link('Launch Event', array('action' => 'submit',$id)); ?>
	</tr>
</table>







